<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="/WEB-INF/tld/jmesa.tld" prefix="jmesa" %> 
<%@ taglib prefix="c" uri="/WEB-INF/tld/c.tld" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   
    <title>My JSP 'list_user.jsp' starting page</title>
    <script type="text/javascript" src="/estate/js/jquery-1.2.2.pack.js"></script>
    <script type="text/javascript" src="/estate/js/jquery-1.3.min.js"></script> 
    <script type="text/javascript" src="/estate/js/jquery.jmesa.js"></script>
    <script type="text/javascript" src="/estate/js/jmesa.js"></script>              
    <link rel="stylesheet" type="text/css" href="/estate/css/jmesa.css"></link>
    <link rel="stylesheet" type="text/css" href="/estate/css/css.css"></link>
    <script type="text/javascript">
    function showlightbox(ShowUrl)
	{
		window.location.href=ShowUrl;
	}
	function closelightbox()
	{
		document.getElementById('lightbox-content').style.display='none';
		document.getElementById('lightbox-bg').style.display='none';
		document.getElementById('lightbox-iframe').src='about:blank';
	}
	function selectAllItems() {
    		var cbArray = document.getElementsByName("cbMulti");
    		var all = document.getElementById("cbAll").checked;
    		for(var i = 0;i<cbArray.length;i++){
    			if(all){
    				cbArray[i].checked = true;
    			}else{
    				cbArray[i].checked = false;
    			}
    		}

		} 
		function deleteConfirm(id)
		{
			question=confirm("确实要删除吗？");
			if(question!=0){
				window.location.href="checkAction.action?method=delete&multiDelete=false&deleteId="+id;
			}
		}
		function enterMultiType(form){
			form.action="/estate/admin/checkAction.action?method=list&multiType=true";

   			form.submit();
		}
		function enterSingleType(form){
			form.action="/estate/admin/checkAction.action?method=list&multiType=false";

   			form.submit();
		}
		function multiDel() {
			form = billingForm;
			var cbArray = document.getElementsByName("cbMulti");
			var delStr = "";
			for(var i = 0;i<cbArray.length;i++){
    			if(cbArray[i].checked){
    				delStr= delStr+cbArray[i].value+",";
    			}
    		}
				window.location.href="checkAction.action?method=delete&multiDelete=true&deleteId="+id;

		}
	</script>
<style>
		#lightbox-content{position:absolute;height:420px;width:820px;margin:-250px 0px 0px -250px;top: 50%;left: 30%;text-align: center;background-color: #FFF;border: 1px solid #000;display:none;z-index:100;overflow:hidden;padding:10px 10px 40px 10px;}
		#lightbox-content p{ margin-top:8px;}
		#lightbox-bg{position:absolute;top:0;left:0;z-index: 90;background:#000;display:none;width:100%;height:100%;_height:2000px;filter:alpha(opacity=70);-moz-opacity:0.6;opacity:0.6;}
	</style>
  </head>
  <body>
    <table border="0" cellpadding="0" cellspacing="0" style="background-image:url(/estate/images/gtbg.gif) " width="100%">
    <tr>
      <td width="50%" height="82" rowspan="2"><img src="/estate/images/guide_01.gif"></td>
      <td width="50%" style="background-image:url(/estate/images/guide_02.gif);color:#cc1212; font-size:16px; font-weight:bold; text-align:right; padding-right:50px; letter-spacing:1px; " height="39"><strong>核销管理</strong></td>
    </tr>
     <tr><td width="50%" style="background-image:url(/estate/images/guide_03.gif); height:43px;" align="center" valign="middle">
	  <table width="50%" border="0" cellspacing="0" cellpadding="0">
        <tr align="center">
        <c:if test="${requestScope.multiType != null}">
          	<c:if test="${requestScope.multiType}">
          		<td><input name="Submit1" type="button" onclick="enterSingleType(checkForm)" onFocus="this.blur();" class="button4" value="单选模式" > </td>
          		<td><input name="Submit1" type="button" onclick="multiDel()" onFocus="this.blur();" class="button4" value="批量删除" > </td>
          	</c:if>
          </c:if>
          <c:if test="${requestScope.multiType == null or !requestScope.multiType}">
          	<td><input name="Submit1" type="button" onclick="enterMultiType(checkForm)" onFocus="this.blur();" class="button4" value="批量模式"> </td>
          </c:if>
		 
        </tr>
      </table></td>
    </tr>
</table><br>
<div align="center" >
	<div class="main" align="center" style="width:100%;height:400px;">
  <form id="checkForm"  name="checkForm" action="checkAction.action?method=list" method="post">

  
      <jmesa:struts2TableModel items="${check}" id="check" var="bean" stateAttr="restore" editable="true" exportTypes="excel"  toolbar="com.estate.utils.JmesaToolBarPage">
          <jmesa:htmlTable width="100%" style="text-align:center" caption="<div style='height:20px;text-align:center;'>核销管理</div>">
              <jmesa:htmlRow uniqueProperty="id">
               <c:if test="${requestScope.multiType != null and requestScope.multiType}">
	              	  <jmesa:htmlColumn editable="false" sortable="false" property="checkbox" title="<input id='cbAll' name='cbAll' type='checkbox' onclick='selectAllItems()'>全选/全不选</input>" ><input type="checkbox" id="cbMulti" name="cbMulti" value="${bean.id }"/></jmesa:htmlColumn>
          </c:if>
                  <jmesa:htmlColumn title="序号" property="id" editable="false"/>
                  <jmesa:htmlColumn title="发票编号" property="billNum" editable="false" sortable="true"/>
                  <jmesa:htmlColumn title="发票类型" property="billCatagory" editable="false" sortable="true"/>
                  <jmesa:htmlColumn title="项目名称" property="proName" editable="false"/>
                   <jmesa:htmlColumn title="项目所属类别" property="proCatagory" editable="false" sortable="true"/>
                   <jmesa:htmlColumn title="总金额（元）" property="cashMoney" editable="false"/>
                   <jmesa:htmlColumn title="核销人" property="checkUser.name" editable="false"/>
                   <jmesa:htmlColumn title="核销日期" property="cashDate" editable="false"/>
                    <jmesa:htmlColumn title="核销状态" property="stateName" editable="false"/>
                   <jmesa:htmlColumn title="操作" editable="false">
                   <c:if test="${bean.state==3}">
                   <a href="checkAction.action?method=modify&modifyId=${bean.id}">核销</a>&nbsp;&nbsp;</c:if>
                   <a onclick="deleteConfirm(${bean.id})" style="cursor: pointer">删除</a>

                   </jmesa:htmlColumn>
              </jmesa:htmlRow>
          </jmesa:htmlTable>
      </jmesa:struts2TableModel>
  </form>
  </div>
  </div>
  <div id="lightbox-bg"></div>
	<div id="lightbox-content">
    <iframe id="lightbox-iframe" width="100%" frameborder="0" scrolling="no" src="about:blank" height="100%" ></iframe> 
     <p><a href="javascript:void(0)" onclick="closelightbox()">关闭</a></p> 
    </div>
  </body>
</html>